﻿
/*----------------------------------------------------------------//
// 文件名：MoUserRole.cs
// 文件功能描述：实体 MoUserRole.
// 
// 创建标识：2009-02-27
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoUserRole
using System;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoUserRole
	/// </summary>
	public partial class MoUserRole:ICloneable
	{
		#region 表UserRole的字段
		private string _uid;
		private string _role_id;
		#endregion
		
		#region 构造函数
		public MoUserRole()
		{
		    
		    
		}
		#endregion
		
		#region 拷贝构造函数

		public MoUserRole(MoUserRole item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoUserRole(string uid,string role_id)
		{
		this._uid=uid;
		this._role_id=role_id;
		}
		#endregion
		
		#region 表UserRole的字段属性
		/// <summary>
		///用户ID默认等于人员编码。如：人员序号1，人员编码 E0001,姓名 张明对应用户表 的用户ID就是E0001.
		/// </summary>
		public string Uid
		{
			get {return _uid;}
			set {_uid=value;}
		}
		/// <summary>
		/// ROLE_ID
		/// </summary>
		public string Role_Id
		{
			get {return _role_id;}
			set {_role_id=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoUserRole CopyTo(MoUserRole item)
        {
		    item.Uid=this.Uid;
		    item.Role_Id=this.Role_Id;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoUserRole NewUserRole=new MoUserRole();
		    NewUserRole._uid=this._uid;
		    NewUserRole._role_id=this._role_id;
			return NewUserRole;
		}
		
		private static MoUserRole _empty = new MoUserRole(string.Empty,string.Empty);
        public static MoUserRole Empty
        {
            get
            {
                return _empty;
            }
        }
		
		///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return true;
            }
            else
            {
                MoUserRole NewUserRole = obj as MoUserRole;
                if (NewUserRole == null)
                {
                    return false;
                }
                else
                {
				if (NewUserRole.Uid==this.Uid && NewUserRole.Role_Id==this.Role_Id)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format("Uid={0}/Role_Id={1}",_uid,_role_id);
		 
		}
		#endregion
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["UID"]!=null && row["UID"]!=DBNull.Value)
			{
			    this.Uid = (string)row["UID"];
			}
			else
			{
				this.Uid =string.Empty;
			}
		    if(row["Role_ID"]!=null && row["Role_ID"]!=DBNull.Value)
			{
			    this.Role_Id = (string)row["Role_ID"];
			}
			else
			{
				this.Role_Id =string.Empty;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["UID"] = this.Uid;
			row["Role_ID"] = this.Role_Id;
		}
		#endregion
	}
}
#endregion
